<template>
  <div class="swiper-box">
    <div class="swiper-container">
      <div class="swiper-wrapper">
        <div class="swiper-slide myslide">
          <div class="child" v-for="(v, i) in arr" :key="i">
            <img
              src="../../images/Screenshot_2022-02-19-10-26-34-15_a173b174840b623_03.png"
              alt=""
            />
            <p>美食外卖</p>
          </div>
        </div>
        <div class="swiper-slide myslide">
          <div class="child" v-for="(v, i) in arry" :key="i">
            <img
              src="../../images/Screenshot_2022-02-19-10-26-34-15_a173b174840b623_03.png"
              alt=""
            />
            <p>美食外卖</p>
          </div>
        </div>
      </div>
      <!-- 如果需要分页器 -->
      <div class="swiper-pagination"></div>
    </div>
  </div>
</template>

<script>
import Swiper from "swiper";
export default {
  data() {
    return {
      arr: [1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 11, 12, 13, 15, 14],
      arry: [1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 11, 12, 13, 15, 14],
    };
  },
  mounted() {
    new Swiper(".swiper-container", {
      loop: false,
      // 如果需要分页器
      pagination: {
        el: ".swiper-pagination",
        bulletClass: "my-bullet",
      },
    });
  },
};
</script>


<style >
.swiper-container {
  width: 100%;
  min-height: 2.5rem;
  margin: 0.1rem auto;
}
.swiper-box {
  width: 100%;
  min-height: 2.4rem;
  font-size: 0.12rem;
  font-weight: 400;
  color: #232323;
  background-color: #fff;
}
.my-bullet {
  width: 0.08rem;
  height: 0.08rem;
  display: inline-block;
  border-radius: 100%;
  background: #000;
  opacity: 0.2;
  bottom: 0;
  position: relative;
  margin-right: 0.05rem;
}
.myslide {
  display: flex;
  justify-content: space-between;
  align-content: flex-start;
  flex-wrap: wrap;
}
.child {
  width: 20%;
  height: 0.71rem;
  margin-bottom: 0.02rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
img {
  width: 0.48rem;
}
</style>
